package com.wj.console.freemarkercode.util;

import java.util.Date;

public class DateUtil {
	
	public static java.text.SimpleDateFormat sdfLong = new java.text.SimpleDateFormat("yyyy-MM-dd");
	
	/**
	 * 获取yyyy-MM-dd格式时间
	 * @param date
	 * @return
	 */
	public static String getDateLong(Date date)
	{
		String nowDate = "";
		try
		{	
			if(date != null)
				nowDate = sdfLong.format(date);
			return nowDate;
		}
		catch (Exception e)
		{
			System.out.println("Error at getDate:" + e.getMessage());
			return "";
		}
	}
	public static void main(String[] args) {
	}
}

